package com.wing.storage.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wing.storage.model.entity.*;
import com.wing.storage.model.response.PurchaseOutDetailExportVO;
import com.wing.storage.model.response.PurchaseOutDetailInfoExportVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 仓库产品出库作业详情-Dao
 *
 * @author xiayang
 */
@Mapper
public interface ProductStorageWorkOutDetailDao extends BaseMapper<ProductStorageWorkOutDetail> {

    /**
     * 仓库产品出库作业详情列表
     *
     * @param params 参数
     * @return
     */
    List<ProductStorageWorkOutDetail> list(@Param("params") Map<String, Object> params);

    /**
     * 仓库产品出库作业详情
     *
     * @param id 仓库产品出库作业详情ID
     * @return
     */
    ProductStorageWorkOutDetail get(Long id);

    /**
     * 根据领料id查询对应物料数据当前总共已经领取了多少
     * @param receiptRecordId
     * @return
     */
    List<ProductStorageWorkOutDetail> selProductStorageNumList(@Param("receiptRecordId") Long receiptRecordId);


    /**
     * 获取出库详情信息
     * @param params
     * @return
     */
    List<ProductStorageWorkOutDetail> getProductStorageWorkOutDetail(@Param("page") Page<ProductStorageWorkOut> page, @Param("params") Map<String, Object> params);


    /**
     * 出库情况统计
     * @return
     */
    List<ProductStorageWorkOutDetailStatic> getProductStorageWorkOutDetailStatic(@Param("page") Page<ProductStorageWorkOut> page, @Param("params") Map<String, Object> params);

    /**
     * 导出出库情况统计
     * @param params
     * @return
     */
    List<PurchaseOutDetailExportVO> exportProductStorageWorkOutDetailStatic(@Param("params") Map<String, Object> params);

    /**
     * 出库明细导出
     * @param params
     * @return
     */
    List<PurchaseOutDetailInfoExportVO> exportProductStorageWorkOutDetail(@Param("params") Map<String, Object> params);



    /**
     * 获取对应领料单剩余物料的  剩余数量
     * @param receiptRecordId
     * @return
     */
    List<ProductStorageWorkOutDetail> selLeaveProductStorageNumList(@Param("receiptRecordId") Long receiptRecordId);

}
